Skip to content

Comments

Extend SQLite schema and implement migration#636

Merged
xlight05 merged 1 commit intoballerina-platform:copilot-library-unifyfrom
VellummyilumVinoth:migration
Feb 2, 2026
Merged

Extend SQLite schema and implement migration#636
xlight05 merged 1 commit intoballerina-platform:copilot-library-unifyfrom
VellummyilumVinoth:migration

Conversation

@VellummyilumVinoth
Copy link
Contributor

@VellummyilumVinoth VellummyilumVinoth commented Jan 14, 2026

Description

It Resolves wso2/product-ballerina-integrator#1909, wso2/product-ballerina-integrator#2251, wso2/product-ballerina-integrator#2252, wso2/product-ballerina-integrator#2253

This PR migrates the Copilot Library Service from static JSON-based library definitions to a SQLite search index–based architecture and improves package metadata extraction and service modeling.

The system now uses a database-driven approach for library and package information, making it more scalable, maintainable, and aligned with the BI package ecosystem.

Key Changes

New Service Implementation

  • Queries search-index.sqlite instead of static JSON files
  • Provides dynamic and structured package metadata retrieval

New Extension Classes

  • Retrieves library lists from the SQLite search index
  • Filters libraries using the Semantic Model API

Enhanced Metadata Handling

  • Added new metadata models:

    • FieldData.java
    • ReturnTypeData.java
    • TypeDefData.java
  • Enhanced FunctionDataBuilder.java to improve function and type modeling

These changes improve representation of types, fields, function signatures, and return structures.

Database and Schema Updates

  • Migrated from central-index.sqlite to search-index.sqlite as the primary data source
  • search-index.sqlite size increased (~17MB to ~18MB) due to richer metadata
  • Added search-index.sql schema definition
  • Updated generic-services.json with service definitions

@VellummyilumVinoth VellummyilumVinoth force-pushed the migration branch 3 times, most recently from bab564b to 6df997a Compare January 14, 2026 14:05
@VellummyilumVinoth VellummyilumVinoth force-pushed the migration branch 2 times, most recently from 36809f6 to 94b02d7 Compare January 22, 2026 06:25
@VellummyilumVinoth VellummyilumVinoth changed the base branch from 1.5.x to copilot-library-unify January 22, 2026 06:27
@VellummyilumVinoth VellummyilumVinoth force-pushed the migration branch 3 times, most recently from 69fa243 to d8c616e Compare January 30, 2026 05:48

@Override
@Test(dataProvider = "data-provider")
public void test(Path config) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About get_filtered_libraries.json, seems like we are asserting the response for http and another library.

We need to make this bit more readable on what we are testing here.

If the idea is to cover set of different libraries (and assume most cases are covered there), we shold have it in the test name.

I'd prefer having multiple test cases, (connector, library, http etc). The idea is that if we break something, we should catch that from tests. We should stratergically cover cases.

@xlight05
Copy link
Contributor

xlight05 commented Feb 2, 2026

Lets address PR comments in a separate PR to this dev branch.

@xlight05 xlight05 merged commit 7beba82 into ballerina-platform:copilot-library-unify Feb 2, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants